Implicit Intent is not working [migrated]

Posted by Sayem Siam on Programmers See other posts from Programmers or by Sayem Siam
Published on 2011-11-27T14:11:38Z Indexed on 2011/11/27 18:04 UTC
Read the original article Hit count: 540

Filed under:

I have a activity class named Notelist.In the Notelist class i have tried to insert a new note.For that i have used implicit Intent.But when i click to insert a new note it gives a run time error.

public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case R.id.menu_add:
        Log.d("sayem", "in case of fd");
        Toast.makeText(this, "in the", Toast.LENGTH_LONG).show();
        startActivity(new Intent(Intent.ACTION_INSERT, getIntent()
                .getData()));
        break;
    default:
        throw new IllegalArgumentException("not matched");
    }
    return true;
}

And i have NoteEditor activity clas to Insert a new note.
And here is my Androidmanifesto.xml file.

<uses-sdk android:minSdkVersion="14" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:label="@string/app_name"
        android:name=".NotesList" >
        <intent-filter >
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
         <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <action android:name="android.intent.action.EDIT" />
            <action android:name="android.intent.action.PICK" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:mimeType="vnd.android.cursor.dir/vnd.google.note" />
        </intent-filter>
        <intent-filter >
            <action android:name="android.intent.action.GET_CONTENT" />

            <category android:name="android.intent.category.DEFAULT" />

            <data android:mimeType="vnd.android.cursor.item/vnd.google.note" />
        </intent-filter>
    </activity>
    <activity android:name="NoteEditor" >
         <intent-filter>
             <action android:name="NoteEditor"></action>
            <action android:name="android.intent.action.INSERT" />
            <action android:name="android.intent.action.PASTE" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:mimeType="vnd.android.cursor.dir/vnd.google.note" />
        </intent-filter>
    </activity>
</application>

© Programmers or respective owner

Related posts about android